<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-7-15
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class RolesModel extends Model{
    //获取角色拥有的cate信息
    public function getCateRoles($cate_id){
        $row = $this->dbreader()->getCateRoles($cate_id);

        return $row;
    }

    //根据role_id 获取 role 信息
    public function get($role_id){
        $ret = $this->dbreader()->get($role_id);

        return $ret;
    }

    //获取角色信息列表<带分页>
    public function getRoleList($curr_page,$per_page,$filter){
        $ret = $this->dbreader()->getRoleList($curr_page,$per_page,$filter);

        return $ret;
    }

    //获取所有角色信息
    public function getRoles($filter = array()){;
        $ret = $this->dbreader()->getRoles($filter);

        return $ret;
    }

    //添加角色信息
    public function addRole($role_name){
        $ret = $this->dbreader()->addRole($role_name);

        return $ret;
    }

    //删除角色信息
    public function delRole($role_id){
        $ret = $this->dbreader()->delRole($role_id);

        return $ret;
    }

    //更新角色信息
    public function updateRole($role_id,$role_name){
        $ret = $this->dbreader()->updateRole($role_id,$role_name);

        return $ret;
    }
}